<div class="divFormFieldLabel" style="position:relative;">{$content.label}: <a href="javascript:void(0);" class="info">[?]<span>{$smarty.config.Forms_filess_info}.</span></a></div>
<div class="divFormFieldInput" id="div{$content.fieldname}_{$obj.obj_id}" style="position:relative;width:500px;">

	<div id="{$content.fieldname}_{$obj.obj_id}_container" {if !is_array($content.files)}style="display:none;"{/if}>	
		<h4 class="line">{$smarty.config.Forms_files_selected}</h4>
		<div id="FilesSortable_{$obj.obj_vers_id}_{$content.fieldname}" style="padding:2px;" class="Files-view">
		{if is_array($field.files)}
			{foreach name="imageloopX" from=$field.files item=file}
				{include file="forms/files_append.tpl" item=$file obj=$obj fieldname=$content.fieldname prefix=$prefix count=$smarty.foreach.imageloopX.iteration}
			{/foreach}
		{/if}
		</div>
	</div>
	
	<h4 class="line">
		<span style="float:left;" onclick="CMS.open_upload('{$content.fieldname}_{$obj.obj_id}')">{$smarty.config.Forms_files_select_new}</span>
		<span style="float:right">
			<a href="javascript:void(0);" onclick="CMS.open_upload('{$content.fieldname}_{$obj.obj_id}')">{strip}
				{if is_array($content.files)}
				<img src="img/icon-formtype-open.gif" style="padding:0;margin:0;" id="{$content.fieldname}_{$obj.obj_id}_upload_switch" vspace="0" hspace="0" border="0" alt="" />
				{else}
				<img src="img/icon-formtype-close.gif" style="padding:0;margin:0;" id="{$content.fieldname}_{$obj.obj_id}_upload_switch" vspace="0" hspace="0" border="0" alt="" />
				{/if}
			{/strip}</a>
		</span>
		<div class="clear" style="margin:0;"></div>
	</h4>
	<div id="{$content.fieldname}_{$obj.obj_id}_upload" style="{if is_array($content.files)}display:none;{/if}">

		{if ($smarty.session.CMS.user_level >= 1000) OR ($smarty.session.CMS.user_flags.general_filemanager)}
			<div style="float:left;width:140px;color:#333;font-size:12px;">{$smarty.config.Forms_files_upload_a}:</div>
			<div style="float:left;"><input type="button" style="width:90px;" value="{$smarty.config.Forms_files_select_image}" onclick="{strip}{literal}
					CMS.FileManager.open(
					{{/literal}
						root:'media',
						project_id:'{$project_id}',
						multiple:true,
						{literal}
						post_params:{
						{/literal}
							obj_id : '{$obj.obj_id}',
							fieldname : '{$content.fieldname}'
						{literal}
						},
						callback:{
							ccdsfun:'FileManagerReturnFiles',
							ccdsclass:'ccdsFileManager'
						},
						returnfield: {
						{/literal}
							container:xajax.$('FilesSortable_{$obj.obj_vers_id}_{$content.fieldname}'),
							outer_container: xajax.$('{$content.fieldname}_{$obj.obj_id}_container')
						{literal}
						}
						});
						{/literal}{/strip}" />
			</div>
		{/if}
		
		{if !empty($content.default_path) || !empty($smarty.session.CMS.user_dir)}
			
			{if !empty($smarty.session.CMS.user_dir) AND !$smarty.session.CMS.user_flags.general_filemanager}
			
				{assign var="upload_dir" value=$smarty.session.CMS.user_dir}
				{assign var="rootdir" value="user"}
			{else}
				{assign var="upload_dir" value=$content.default_path}
				{assign var="rootdir" value="media"}
			{/if}
			
			{if ($smarty.session.CMS.user_level >= 1000) OR ($smarty.session.CMS.user_flags.general_filemanager)}
				<div class="clear" style="border-bottom:1px solid #d7d7d7;padding-top:10px;margin-bottom:10px;"></div>	
			{/if}
			<div style="float:left;width:140px;color:#333;font-size:12px;">{$smarty.config.Forms_files_upload_b}:</div>
			<div class="clear"></div>	
			<div>
				<div style="float:left;width:125px;margin-left:15px;">
					<h5>{$smarty.config.Forms_files_dest_folder}:</h5>
				</div>

				<div style="float:left;">
					{$smarty.config.Forms_files_upload_dir1}:<br />
					&quot;<span id="{$content.fieldname}_{$obj.obj_id}_path_label">{$upload_dir}&quot;</span><br />
					{if $smarty.session.CMS.user_flags.general_filemanager}
						(<a href="javascript:void(0);" onclick="{strip}
						{literal}xajax.request({
										ccdsfun:'FileManagerDirSelectorOpen',
										ccdsclass:'ccdsFileManager'	
						},
						{
							parameters:
								[
									{{/literal}
										root:'media',
										dir:'/',
										project_id:'{$project_id}',
										field:'{$content.fieldname}_{$obj.obj_id}_path'
									{literal}}
								]
							}
							);
					{/literal}{/strip}">{$smarty.config.Forms_files_change_dir}</a>){/if}<br />
				</div>
				<div class="clear"></div>	

				<div style="float:left;width:125px;margin-left:15px;">
					<h5>Dateiauswahl:</h5>
				</div>
				<div style="float:left;">
					<div>
						<input type="hidden" name="path" id="{$content.fieldname}_{$obj.obj_id}_path" value="{$upload_dir}" />
						<input type="input"  name="{$content.fieldname}_{$obj.obj_id}_multiup" id="{$content.fieldname}_{$obj.obj_id}_multiup" />
					</div>
		
					<input type="button" class="submitbtn" value="{$smarty.config.Forms_files_upload}" style="width:160px;" onclick="{strip}
					{literal}
						xajax.request({
										ccdsfun:'ContentEditorFilesUpload',
										ccdsclass:'ccdsContentEditor'	
						},
						{
							parameters:
								[
									{{/literal}
										obj_id:{$obj.obj_id},
										obj_vers_id:xajax.$('obj_vers_id_{$obj.obj_id}').value,
										path:xajax.$('{$content.fieldname}_{$obj.obj_id}_path').value,
										filefield:'{$content.fieldname}_{$obj.obj_id}_multiup',
										fieldname:'{$content.fieldname}',
										root:'{$rootdir}'
									{literal}}
								],
								mode:'SWFupload',
								SWFfield:'{/literal}{$content.fieldname}_{$obj.obj_id}_multiup{literal}',
								context:{/literal} xajax.$('FilesSortable_{$obj.obj_vers_id}_{$content.fieldname}'){literal}
							}
							);
						{/literal}
						{/strip}" />
				</div>
				<div class="clear"></div>	
			{/if}
		</div>
	</div>
</div>
<br style="clear:both;" />